<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>返乡登记录入</title>
  <link rel="stylesheet" href="../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../style/wangeditor.css">
  <link rel="stylesheet" href="../../yl/style.css" />
  <link rel="stylesheet" href="../../yl/mobile.css" />
  <link rel="stylesheet" href="../../yl/easyui.css" />
  <link rel="stylesheet" href="../../yl/icon.css" />
  <style>
    .full-width-container {
      width: 100vw;
      margin-left: -20px;
      padding: 20px;
      box-sizing: border-box;
    }

    /* 容器基础样式 */
    .dia_y {
      width: 50%;
      margin: 1%;
      height: 400px;
      overflow-y: auto;
      overflow-x: hidden;
      position: relative;
      /* border: 1px solid #ccc; /* 加上边框更贴近示例 */
      border-radius: 4px;
    }

    .dia_z {
      /* border: 2px solid #ccc; */
      width: 50%;
      margin: 1%;
      height: 400px;
      overflow-y: auto;
      overflow-x: hidden;
      position: relative;
      /* 为子元素固定定位提供参考 */
    }

    .sticky-input {
      position: sticky;
      top: 0;
      /* 固定在容器顶部 */
      background: #fff;
      /* 背景色与容器一致 */
      z-index: 10;
      /* 确保输入框在树组件上方 */
      padding: 10px 0;
      /* 保持与原布局一致的间距 */
      border-bottom: 1px solid #eee;
      /* 可选：添加分隔线 */
    }

    .scroll-content {
      padding-top: 10px;
      /* 为固定输入框留出空间 */
      height: calc(100% - 50px);
      /* 滚动内容区域高度 */
    }

    /* 顶部统计栏 */
    .xuche {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 15px;
      background-color: #f5f7fa;
      border-bottom: 1px solid #e4e7ed;
    }

    /* 多选框列表区域 */
    .checkbox-grid {
      padding: 10px 15px;
    }

    /* 调整多选框样式，让每个选项垂直分布更合理 */
    .el-checkbox {
      display: block;
      margin-bottom: 8px;
    }

    /* 滚动条样式（可选，让滚动条更美观） */
    .dia_y::-webkit-scrollbar {
      width: 6px;
    }

    .dia_y::-webkit-scrollbar-thumb {
      background-color: #c0c4cc;
      border-radius: 3px;
    }

    .dia_y::-webkit-scrollbar-track {
      background-color: #f5f7fa;
    }
  </style>
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar" v-cloak>
        <div class="m-title">返乡登记录入</div>
      </div>
    </header>

    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'round_trip_registration', 'form': 'dataForm','primary_key':'Registration_SerialNumber' })">

      <el-form :model="dataForm" ref="form" inline-message="true" style="width: 100%">
        <el-descriptions :column="1" size="large" border>


          <el-descriptions-item>
            <template #label>
              <div class="cell-item">返乡人</div>
            </template>
            <el-form-item prop="ID_Card_Number" :rules="[{ required: true, message: '请选择返乡人', trigger: 'change' }]">

              <yl-select @change="changePersonal($event,dataForm)" v-model="dataForm.ID_Card_Number" clearable
                :disabled="Object.keys(dataForm).some(function(aaaa){ return aaaa.includes('_Original')})"
                filterable placeholder="请选择返乡人" :options="personal_information"
                :props="{value:'ID_Card_Number',label:'Personal_Name'}">
                <el-table-column prop="ID_Card_Number" width="180" show-overflow-tooltip label="身份证号"></el-table-column>
                <el-table-column prop="Personal_Name" show-overflow-tooltip label="姓名"></el-table-column>
                <el-table-column prop="Birthday" show-overflow-tooltip label="出生日期"></el-table-column>
                <el-table-column prop="Gender" label="性别"></el-table-column>
                <el-table-column prop="Nation" label="民族"></el-table-column>
                <el-table-column prop="Registered_Residence" show-overflow-tooltip label="籍贯"></el-table-column>
                <el-table-column prop="Contact_Phone" label="联系方式"></el-table-column>
              </yl-select>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">返乡日期</div>
            </template>
            <el-form-item prop="Return_Date" :rules="[{ required: true, message: '请选择日期', trigger: 'blur' }]">

              <el-date-picker v-model="dataForm.Return_Date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
                class="borderless-input" type="date" placeholder="请选择日期" size="large" clearable/>
            </el-form-item>
          </el-descriptions-item>

          <el-descriptions-item>
            <template #label>
              <div class="cell-item">联系电话</div>
            </template>
            <el-form-item prop="Contact_Phone">
              <el-input v-model="dataForm.Contact_Phone" class="borderless-input" placeholder="请输入联系电话" />
            </el-form-item>
          </el-descriptions-item>

          <el-descriptions-item>
            <template #label>
              <div class="cell-item">地址</div>
            </template>
            <el-form-item prop="Address">
              <el-input v-model="dataForm.Address" class="borderless-input" placeholder="请输入居住地址" />
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item>
            <template #label>
              <div class="cell-item">备注</div>
            </template>
            <el-form-item prop="Memo">
              <el-input v-model="dataForm.Memo" class="borderless-input" placeholder="请输入备注" />
            </el-form-item>
          </el-descriptions-item>

        </el-descriptions>
      </el-form>


      <div id="ChildTable">


        <div class="m-toolbar" v-cloak>
          <div class="m-title">随行人员{{childDataForm.filter(item => item.Row_Status != '1').length == 0?'(暂无数据)':''}}
          </div>
        </div>

        <div class="operation" style="float: right;">
          <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
          <el-button type="danger" size="small" @click="handleRemove('childDataForm',0)">删除</el-button>
        </div>

        <el-form :model="{childDataForm}" ref="form1" inline-message="true" style="width: 100%">
          <el-descriptions
            :data-options="JSON.stringify({ 'TableName': 'round_trip_registration_entourage', 'form': 'childDataForm', 'ParentTableName': 'round_trip_registration'})"
            :column="1" size="large" border v-for="(item,index) in childDataForm.filter(item => item.Row_Status != '1')"
            :key="index">

            <el-descriptions-item>
              <template #label>
                <div class="cell-item">随行人员</div>
              </template>
              <el-form-item :prop="'childDataForm.'+index+'.Personal_Name'"
                :rules="[{ required: true, message: '请输入随行人员', trigger: 'blur' }]">
                <!-- <yl-select @change="changePersonal($event,dataForm)" v-model="item.ID_Card_Number" clearable filterable
                  placeholder="请选择随行人员" :options="personal_information"
                  :props="{value:'ID_Card_Number',label:'Personal_Name'}">
                  <el-table-column prop="ID_Card_Number" width="180" show-overflow-tooltip
                    label="身份证号"></el-table-column>
                  <el-table-column prop="Personal_Name" show-overflow-tooltip label="姓名"></el-table-column>
                  <el-table-column prop="Birthday" show-overflow-tooltip label="出生日期"></el-table-column>
                  <el-table-column prop="Gender" label="性别"></el-table-column>
                  <el-table-column prop="Nation" label="民族"></el-table-column>
                  <el-table-column prop="Registered_Residence" show-overflow-tooltip label="籍贯"></el-table-column>
                  <el-table-column prop="Contact_Phone" label="联系方式"></el-table-column>
                </yl-select> -->
                <el-input v-model.trim="item.Personal_Name" class="borderless-input" placeholder="请输入随行人员" />
              </el-form-item>
            </el-descriptions-item>

            <el-descriptions-item >
              <template #label>
                <div class="cell-item">与本人关系</div>
              </template>
              <el-form-item :prop="'childDataForm.'+index+'.Relation_Type_SerialNumber'"
                :rules="[{ required: true, message: '请输入与本人关系', trigger: 'blur' }]">
                <el-input v-model.trim="item.Relation_Type_SerialNumber" class="borderless-input"
                  placeholder="请输入与本人关系" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">证件号码</div>
              </template>
              <el-form-item :prop="'childDataForm.'+index+'.ID_Card_Number'"
                :rules="[{ required: true, message: '请输入证件号码', trigger: 'blur' }]">

                <el-input v-model.trim="item.ID_Card_Number" class="borderless-input" placeholder="请输入证件号码" />
              </el-form-item>
            </el-descriptions-item>

            <el-descriptions-item>
              <template #label>
                <div class="cell-item">备注</div>
              </template>
              <el-form-item :prop="'childDataForm.'+index+'.Memo'">

                <el-input v-model.trim="item.Memo" class="borderless-input" placeholder="请输入备注" />
              </el-form-item>
            </el-descriptions-item>

          </el-descriptions>
        </el-form>
      </div>

    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit1" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>

<script src="../../utils/utils.js"></script>
<script src="../../utils/compressor.js"></script>
<script src="../../utils/wangeditor.js"></script>
<script src="../../config/config.js"></script>
<script src="../../utils/mixins.js"></script>
<script src="../../yl/vue.js"></script>
<script src="../../utils/ID_Validity.js"></script>
<script src="../../yl/index.js"></script>
<script src="../../yl/zh-cn.mjs"></script>
<script src="../../yl/index.iife.min.js"></script>
<script src="../../yl/jquery.min.js"></script>
<script src="../../utils/jquery.cookie.js"></script>
<script src="../../yl/jquery.easyui.min.js"></script>
<script src="../../yl/jquery.easyui.mobile.js"></script>
<script src="../../yl/moment.min.js"></script>
<script src="../../api/request.js"></script>

<script src="./js/add.js"></script>

</html>